<script setup>
import { onMounted } from 'vue'
import qq from '@/components/yy.vue'
import uu from '@/components/uu.vue'
import pp from '@/components/pp.vue'
import { ref } from 'vue'
var rr = ref(uu)
function lk() {
    rr.value = uu
}
function op() {
    rr.value = pp
}
function ch() {
    rr.value = qq
}
</script>
<template>
    <div class="box">
        <div class="gua">
            <button @click="lk">故事</button>
            <button @click="ch">计算方法</button>
            <button @click="op">公式</button>
        </div>
        <component :is=rr></component>
    </div>
</template>
<style scoped>
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 12px;
}

.box {
    box-shadow: #ccc 5px 5px 5px;
    height: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 500px;
    background-color: cornflowerblue;
    border-radius: 20px;
    background-image: url(../assets/hh.png);
    background-position: initial;
    background-size: 500px;
}

.zhu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zhu input {
    width: 130px;
    padding: 5px;
    border: 1px #ccc solid;
    outline: none;
    border-radius: 20px;
}

.zhu button {
    background-color: aquamarine;
    border: none;
    width: 50px;
    height: 30px;
    border-radius: 20px;
    margin: 0 auto;
}

.zuo {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wb {
    padding-right: 100px;
}

.jx span {
    color: red;
}

.jx {
    transition: all 1s;
    opacity: 0;

}

.jx:hover {
    opacity: 1;
}

.gua {
    width: 100%;
    position: absolute;
    top: 10px;
    display: flex;
    gap: 5px;
    padding: 5px;
}

.gua button {
    height: 20px;
    flex: 1;
    border: none;
    background-color: rgba(252, 88, 175, 0.5);
    border-radius: 20px;
    font-style: italic;
    font-weight: bold;
}
</style>